<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;


class AdPositionId extends Model
{
    protected $table = 'ad_position_id';
    public $timestamps = false;

    public function ads()
    {
        return $this->hasMany(Ad::class, 'ad_position_id');
    }

    public static function getAdPositionIdByCode($code)
    {
        return self::query()->where('code',$code)->first();
    }
}
